package com.shujia.spark.core

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object Demo13Count {
  def main(args: Array[String]): Unit = {

    val conf = new SparkConf().setMaster("local").setAppName("Demo13Count")
    val sc = new SparkContext(conf)

    val studentsRDD: RDD[String] = sc.textFile("spark/data/students.txt")


    /**
      * count  统计行数
      * count是一个action算子  ，触发job执行
      */
    val count = studentsRDD.count()

    println(count)
  }

}
